﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace TOLibrary
{
    public class OperationLibrary
    {
        public static Operation CreateOperator(string opera)
        {
            Operation operation = null;

            switch (opera)
            {
                case "+":
                    {
                        operation = new OperationAdd();
                        break;
                    }
                case "-":
                    {
                        operation = new operationSub();
                        break;
                    }
                case "*":
                    {
                        operation = new OperationMul();
                        break;
                    }
                case "/":
                    {
                        operation = new OperationDiv();
                        break;
                    }
                case "sqr":
                    {
                        operation = new OperationSqr();
                        break;
                    }
                case "sqrt":
                    {
                        operation = new OperationSqrt();
                        break;
                    }
                case "+/-":
                    {
                        operation = new OperationReverse();
                        break;
                    }
                default:
                    break;
            }
            return operation;
        }

    }
}
